package assists
{
	import assists.log.Log;
	
	import flash.filters.BitmapFilterQuality;
	import flash.text.TextField;
	import flash.text.TextFormat;
	import flash.filters.DropShadowFilter;
	
	public class TextFieldUtils
	{
		
		public static function setHtmlText(textField:TextField, htmlText:String,isHtml:Boolean = true,hasFilter:Boolean = false):void
		{
			if(textField == null) return;
			
//			textField.filters = [];
			
			if(hasFilter == true){
				var wordFilter:DropShadowFilter = new DropShadowFilter();
				wordFilter.blurX = 3;
				wordFilter.blurY = 3;
				wordFilter.distance = 0;
				wordFilter.alpha = 0.6;
				wordFilter.strength = 10;
				wordFilter.color = 0;
				wordFilter.quality = 1;
				var myFilters:Array = [];	
				myFilters.push(wordFilter);	
				textField.filters = myFilters;
			}
			if(isHtml)
			{
				textField.htmlText = htmlText;
			}else
			{
				textField.htmlText = "<font font='" + HtmlText.FONT_NAME + "' size='" + (HtmlText.FONT_SIZE + HtmlText.NUMBER_FONT_CHANGE) + "' >" + htmlText + "</font>";
			}
		}
		
	}
}